1 /****************************** Module Header ******************************\
2 * Module Name: CppWin7MultiTouch.cpp
3 * Project: CppWin7MultiTouch
4 * Copyright (c) Microsoft Corporation.
6 * Defines the entry point for the application.
8 * This source is subject to the Microsoft Public License.
9 * See http://www.microsoft.com/opensource/licenses.mspx#Ms-PL.
10 * All other rights reserved.
12 * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
13 * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
14 * WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
15 \***************************************************************************/
19 #include "CppWin7MultiTouch.h"
21 MainWindow
*g_pMainWindow
;
23 int APIENTRY
_tWinMain(HINSTANCE hInstance
,
24 HINSTANCE hPrevInstance
,
28 // Ignore the return value because we want to run the program even in the
29 // unlikely event that HeapSetInformation fails.
30 HeapSetInformation(NULL
, HeapEnableTerminationOnCorruption
, NULL
, 0);
33 HRESULT hr
= CoInitializeEx(NULL
, COINIT_APARTMENTTHREADED
| COINIT_DISABLE_OLE1DDE
);
36 MessageBox(NULL
, L
"COM intialization failed! Cannot run the program!",
37 L
"Critical Error", MB_OK
| MB_ICONERROR
);
41 g_pMainWindow
= new MainWindow(hInstance
);
43 // Perform application initialization:
44 if (FAILED(g_pMainWindow
->Initialize()))
48 g_pMainWindow
->RunMessageLoop();